$"="-";
@s = slog("kalifornija");
print "@s";

sub slog {
	$zbor=@_[0];
	@bukvi=split('',$zbor);
	$pos=-1;
	foreach (@bukvi) {
		@pos[++$pos]=0;
		if (/[aeoui]/) {
			++$voc;
			$pos[$pos]=1;
		};
	};
	$broj=@bukvi;
	for ($i=1;$i<=$broj;$i++) {
		$moze=1 if ($pos[$br]==1);
		if (($moze) and ($pos[$br]==1) and ($pos[$br+1] != $pos[$br+2])) {
			$slog[$brs].=$bukvi[$br];
			$brs++;
			$moze=0;
		} elsif (($moze) and ($pos[$br]==0) and ($pos[$br] == $pos[$br+1])) {
			$slog[$brs].=$bukvi[$br];$brs++;$moze=0
		} else {
			$slog[$brs].=$bukvi[$br];
		};
		++$br;
	}
	return @slog;
}
